package com.kongyz;

import com.kongyz.state.StartState;
import com.kongyz.state.StopState;

/**
 * @author kongyz
 * @date 2018/7/3 22:18
 * @Description:
 */
public class Demo {
    public static void main(String[] args) {
        //使用Context和状态对象来演示Context在状态改变时的行为变化

        Context context=new Context();
        StartState startState=new StartState();
        startState.doAction(context);
        System.out.println(context.getState().toString());

        StopState stopState=new StopState();
        stopState.doAction(context);
        System.out.println(context.getState().toString());

    }
}
